package com.hh.front.controller;

import com.hh.common.page.CommonPage;
import com.hh.common.request.PageParamRequest;
import com.hh.common.response.CommonResult;
import com.hh.common.response.integral.UserIntegralRecodResponse;
import com.hh.service.service.user.UserIntegralService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController()
@RequestMapping("api/front/userIntegral")
public class UserIntegralController {

    @Autowired
    private UserIntegralService userIntegralService;

    /**
     * 用户积分记录
     * @param timeType
     * @param pageRequest
     * @return
     */
    @RequestMapping(value = "/record", method = RequestMethod.GET)
    public CommonResult<CommonPage<UserIntegralRecodResponse>> recordList(@RequestParam(name = "timeType") Integer timeType, @ModelAttribute PageParamRequest pageRequest) {
        return CommonResult.success(userIntegralService.recordList(timeType, pageRequest));
    }
}
